Skip to content

[3.11] gh-91539: improve performance of get_proxies_environment (GH-91566)#97918

Closed
miss-islington wants to merge 3 commits into
python:3.11from
miss-islington:backport-aeb28f5-3.11
Closed

[3.11] gh-91539: improve performance of get_proxies_environment (GH-91566)#97918
miss-islington wants to merge 3 commits into
python:3.11from
miss-islington:backport-aeb28f5-3.11

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 5, 2022

Copy link
Copy Markdown
Contributor
  • improve performance of get_proxies_environment when there are many environment variables

  • 📜🤖 Added by blurb_it.

  • fix case of short env name

  • fix formatting

  • fix whitespace

  • whitespace

  • Update Lib/urllib/request.py

Co-authored-by: Carl Meyer carl@oddbird.net

  • Update Lib/urllib/request.py

Co-authored-by: Carl Meyer carl@oddbird.net

  • Update Lib/urllib/request.py

Co-authored-by: Carl Meyer carl@oddbird.net

  • Update Lib/urllib/request.py

Co-authored-by: Carl Meyer carl@oddbird.net

  • whitespace

  • Update Misc/NEWS.d/next/Library/2022-04-15-11-29-38.gh-issue-91539.7WgVuA.rst

Co-authored-by: Carl Meyer carl@oddbird.net

  • Update Lib/urllib/request.py

Co-authored-by: Carl Meyer carl@oddbird.net

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Carl Meyer carl@oddbird.net
(cherry picked from commit aeb28f5)

Co-authored-by: Pieter Eendebak pieter.eendebak@gmail.com

…nGH-91566)

* improve performance of get_proxies_environment when there are many environment variables

* 📜🤖 Added by blurb_it.

* fix case of short env name

* fix formatting

* fix whitespace

* whitespace

* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>

* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>

* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>

* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>

* whitespace

* Update Misc/NEWS.d/next/Library/2022-04-15-11-29-38.gh-issue-91539.7WgVuA.rst

Co-authored-by: Carl Meyer <carl@oddbird.net>

* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
(cherry picked from commit aeb28f5)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>

@orsenthil orsenthil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@miss-islington

Copy link
Copy Markdown
Contributor Author

Sorry, I can't merge this PR. Reason: Head branch was modified. Review and try the merge again..

@ambv

ambv commented Oct 5, 2022

Copy link
Copy Markdown
Contributor

This is a perf optimization, currently we're accepting changes for 3.11.1+ which are bug fixes only. Therefore, this change cannot be included in 3.11.

@ambv ambv closed this Oct 5, 2022
@miss-islington miss-islington deleted the backport-aeb28f5-3.11 branch October 5, 2022 22:46
@FrederikP

Copy link
Copy Markdown

I was wondering whether this will be merged at some point? It seems to be included in latest python 3.10 but not latest 3.11, if I saw it correctly.
Thanks

@morotti

morotti commented Jul 19, 2024

Copy link
Copy Markdown
Contributor

so sad this fix was merged in master and merged in 3.10 but the merged in 3.11 was blocked for no reason :( :( :(

requests is using this urllib get_proxies_environment function to get proxy settings on every HTTP request.
when you install packages with pip install xxx, about 5% of the run time is just fetching proxy settings again and again through this function.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants